package com.sgam.mf.service.entity;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sgam.mf.dao.entity.ContractsDAO;
import com.sgam.mf.domain.entity.ContractPayments;
import com.sgam.mf.domain.entity.Contracts;
import com.sgam.mf.helper.ProxyCurrentUser;
import com.sgam.mf.service.GenericServiceImpl;

@Service
public class ContractsServiceImpl extends GenericServiceImpl<Contracts, ContractsDAO>
		implements ContractsService {

	protected final Logger log = Logger.getLogger(getClass());
	
	@Autowired
	public ContractsServiceImpl(ContractsDAO tDao) {
		super(tDao);
	}

	@Transactional
	public List<Contracts> list(ProxyCurrentUser user, int listType) {
		log.debug("ContractsServiceImpl - list");
		List<Contracts> result = gettDao().list(user, listType);
		return result;
	}
	
	@Transactional
	public List<Contracts> listContr(ProxyCurrentUser user, Integer pPersonalId, Integer pPartnerId) {
		log.debug("ContractsServiceImpl - listPay");
		List<Contracts> result = gettDao().listContr(user, pPersonalId, pPartnerId);
		return result;
	}
	
	@Transactional
	public List<ContractPayments> listPay(ProxyCurrentUser user, Integer pContractId, Integer pPersonalId, Integer pPartnerId) {
		log.debug("ContractsServiceImpl - listPay");
		List<ContractPayments> result = gettDao().listPay(user, pContractId, pPersonalId, pPartnerId);
		return result;
	}
}
